package cc.lj.internal.api.coupons.api.ticket;

import cc.lj.internal.api.core.config.FeignConfiguration;
import cc.lj.internal.api.coupons.api.ticket.fallbackfactory.TicketPayRecordFeignServiceFallbackFactory;
import cc.lj.internal.api.coupons.dto.TicketPayRecordApiDTO;
import cc.lj.internal.api.coupons.dto.command.TicketPayRecordApiUpdateCommand;
import cc.lj.internal.api.coupons.dto.querty.TicketPayRecordApiQuery;
import cc.lj.internal.core.http.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 合同收券表对外feign api
 * @author liangxifeng
 * @date 2022-01-13
 */
@FeignClient(contextId = "f-lj-internal-coupons-ticketPayRecordFeignService",
        name = "lj-internal-coupons",
        //url = "http://192.168.15.110:8050",
        url = "${feign.couponsUrl}", //后续如果使用nacos服务发现，则将改行去掉即可
        path = "ticketPayRecord",
        configuration = {FeignConfiguration.class},
        fallbackFactory = TicketPayRecordFeignServiceFallbackFactory.class
)
public interface TicketPayRecordFeignService {
    /**
     * 等值查询list
     * @param ticketPayRecordApiQuery
     * @return
     */
    @PostMapping("/getList")
    HttpResult<List<TicketPayRecordApiDTO>> getList(@RequestBody TicketPayRecordApiQuery ticketPayRecordApiQuery);

    /**
     * 通过主键修改合同收券表数据
     * @param ticketPayRecordApiUpdateCommand
     * @return
     */
    @PostMapping("/updateById")
    HttpResult<Integer> updateById(@RequestBody TicketPayRecordApiUpdateCommand ticketPayRecordApiUpdateCommand);
}
